package com.scy.java.object;
//矩形类
public class Rectangle {
    double length;
    double width;
    //计算矩形的面积
    public double area(){
        return length*width;
    }
    //计算周长
    public double perime(){
        return (length+width)*2;
    }

    //打印信息
    public String getinfo() {
        return "矩形的信息为{" +
                "长=" + length +
                ", 宽=" + width +
                ",面积=" + area() +
                ", 周长=" + perime() +
                '}';
    }
}
